<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles"
	prefix="tiles"%>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/css/style.css">
<script language="JavaScript"
	src="<%=request.getContextPath()%>/js/util.js"></script>
<title><tiles:insert flush="false" attribute="title" /></title>
</head>
<body>
<f:view>
	<f:loadBundle basename="resource.bundle.messages" var="messages" />

	<h:form>
		<rich:panel header="#{messages['select.installment.schema']}">
			<h:panelGrid>
				<h:outputText value="#{errorBean.errorMessage}" styleClass="error"></h:outputText>
			</h:panelGrid>
			
			
			<t:panelGrid columns="2" columnClasses="standardTable_ColumnLeft_20,standardTable_ColumnLeft_80" width="100%">
			
				<h:outputText></h:outputText>
				<t:message for="installment" styleClass="error"></t:message>
				
				<h:panelGroup>
				  	<h:outputText value="*" styleClass="standardText_Mandatory" /> 
					<h:outputText value="#{messages['installment.schema']}" styleClass="standardText_Label" />
				</h:panelGroup>
				<t:selectOneMenu id="installment" styleClass="standardText" value="#{registrationBean.schemaId}" required="true">
					<f:selectItem itemLabel="#{messages['please.select']}"
							itemValue="" /> 
					<f:selectItems value="#{registrationBean.schemaSelectList}"/>
					<a4j:support ajaxSingle="true" event="onclick" reRender="detail"></a4j:support>
				</t:selectOneMenu>
				
			</t:panelGrid>
			
			<t:panelGrid id="detail" columns="3" columnClasses="standardTable_ColumnLeft_20,standardTable_ColumnLeft_20,standardTable_ColumnLeft_60" width="100%">
				<h:outputText value="#{messages['deposit']}" styleClass="standardText_Label" />
				<h:outputText id="deposit" value="#{registrationBean.deposit}" styleClass="standardText">
					<f:convertNumber pattern="#,###,###,##0.00"/>
				</h:outputText>
				<h:commandButton immediate="true" value="#{messages['select.deposit.installment.schema']}" 
				rendered="#{empty registrationBean.downPaymentSchema}" styleClass="button" action="#{registrationBean.navSelectDownPaymentAction}"></h:commandButton>
				<h:commandButton immediate="true" value="#{messages['remove']}" 
				rendered="#{!empty registrationBean.downPaymentSchema}" styleClass="button" action="#{registrationBean.removeDownPaymentAction}"></h:commandButton>
				
				<h:outputText value="#{messages['monthly.payment']}" styleClass="standardText_Label" />
				<h:outputText value="#{registrationBean.monthPay}" styleClass="standardText">
					<f:convertNumber pattern="#,###,###,##0.00"/>
				</h:outputText>
				<h:outputText></h:outputText>
				
				<h:outputText value="#{messages['months']}" styleClass="standardText_Label" />
				<h:outputText id="month" value="#{registrationBean.month}" styleClass="standardText">
				</h:outputText>
				<h:outputText></h:outputText>
			
			</t:panelGrid>
			
			<t:panelGrid  columns="2" columnClasses="standardTable_ColumnLeft_20,standardTable_ColumnLeft_80" width="100%">
			<h:outputText></h:outputText>
			<h:commandButton styleClass="button" value="#{messages['select']}" action="#{registrationBean.navSchemaCreatePayment}" 
			actionListener="#{registrationBean.paymentSchemaActionListener}">
					</h:commandButton>
			</t:panelGrid>
			
		</rich:panel>
	</h:form>
</f:view>
</body>
</html>
